//*******************************************************************       //
//IMPORTANT NOTICE                                                          //
//================                                                          //
//Copyright Mentor Graphics Corporation 1996 - 1999.  All rights reserved.  //
//This file and associated deliverables are the trade secrets,              //
//confidential information and copyrighted works of Mentor Graphics         //
//Corporation and its licensors and are subject to your license agreement   //
//with Mentor Graphics Corporation.                                         //
//                                                                          //
//Use of these deliverables for the purpose of making silicon from an IC    //
//design is limited to the terms and conditions of your license agreement   //
//with Mentor Graphics If you have further questions please contact Mentor  //
//Graphics Customer Support.                                                //
//                                                                          //
//This Mentor Graphics core (m8051w v2002.080) was extracted on             //
//workstation hostid 8316cbec Inventra                                      //
// M8051W/EW Test Bench 
// 
// $Log: m8051w_tb.v,v $
// Revision 1.1  2002/01/09
// Final testbench changes for version2
//
// Revision 1.1  2001/11/14
// First EW checkin
//
// Revision 1.2  2000/03/06
// Revised configuration scheme
//
// Revision 1.1  2000/02/05
// Name change from m8051e to m8051ewarp
//
// Revision 1.1.1.1  1999/10/28
// "initialization and source check-in for m8051e"
//
//
////////////////////////////////////////////////////////////////////////////////
//
// Purpose      :       M8051W/EW Soft Core Test Bench
//
////////////////////////////////////////////////////////////////////////////////

`include "m8051w_tb_cfg.v"

module m8051w_tb();  
//*******************************************************************       //
//IMPORTANT NOTICE                                                          //
//================                                                          //
//Copyright Mentor Graphics Corporation 1996 - 1999.  All rights reserved.  //
//This file and associated deliverables are the trade secrets,              //
//confidential information and copyrighted works of Mentor Graphics         //
//Corporation and its licensors and are subject to your license agreement   //
//with Mentor Graphics Corporation.                                         //
//                                                                          //
//Use of these deliverables for the purpose of making silicon from an IC    //
//design is limited to the terms and conditions of your license agreement   //
//with Mentor Graphics If you have further questions please contact Mentor  //
//Graphics Customer Support.                                                //
//                                                                          //
//This Mentor Graphics core (m8051w v2002.080) was extracted on             //
//workstation hostid 8316cbec Inventra                                      //
               
  tri1 [7:0] PORT0;
  tri  [7:0] PORT1, PORT2, PORT3;

  reg           XTAL1, RST, TRESET;
  

m8051w_wrapper uRAP (.PORT0(PORT0), .PORT1(PORT1), .PORT2(PORT2),
                      .PORT3(PORT3), .XTAL2(XTAL2), .NPSEN(NPSEN),
                      .XTAL1(XTAL1), .RST(RST), .TRESET(TRESET));

/* Clock oscillator process */
initial
begin
   XTAL1 = 1'b0;
   forever
           #`Thclk XTAL1 = !XTAL1;
end

/* Reset process */
initial
begin
  // Test reset
  RST    = 1'b0;
  TRESET = 1'b1;
  #`Ttres TRESET = 1'b0;

  // Run
  #`Tclk;
  #`Tclk;
  #`Tclk;
  #`Tclk;

  // Compatible reset
  RST    = 1'b1;
  #`Tres  RST    = 1'b0;

  // Run
  #`Tmaxrun;
  $display("Error:       At time %t, simulation time exhausted", $time);
  $stop;
end

// Create switchable loop back between TXD and RXD pins for serial interface
assign PORT3[0] = PORT3[7]? 1'bz: PORT3[1];

endmodule
